<template>
        <div class="child">
                <h2>子组件1</h2>
                <h3>玩具：{{ toy }}</h3>
                <h3>书：{{ books }} 本</h3>
                <button @click="getHosue($parent)">给我一套房</button>
        </div>
</template>
<script lang="ts" setup>
import {ref} from 'vue'
let toy = ref('孙悟空')
let books = ref(3)
function getHosue(parent: any){
      parent.house -= 1  
}
defineExpose({toy,books})
</script>
<style scoped>
.child {
        background-color: rgb(76, 209, 76);
        padding: 10px;
        box-shadow: 0 0 10px black;
        border-radius: 10px;
        margin-top: 20px;
}
</style>